#ifndef CONFIG
#define CONFIG

//-----Microcontroller Output Pins-------

//motor.h
#define MOTOR_LEFT_OUT  P1_7 //Controls the on/off state of the left motor
#define MOTOR_RIGHT_OUT P1_6 //Controls the on/off state of the right motor
#define MOTOR_LEFT_PIN  P1M1_7
#define MOTOR_RIGHT_PIN P1M1_6

//pid.h  
#define LEFT_SENSOR 2 //Pin, line tracking sensor left
#define RIGHT_SENSOR 1 //Pin, line tracking sensor right
#define MID_SENSOR 3 //Pin, intersection, start, and finish detection sensor.
#define BATTERY_SENSOR 4
#define ERROR_THRESH 0

//----Variable Designations----

//motor.h, pid.h
#define MOTOR_LEFT 1 //Refers to the left motor, used by function setMotorSpeed.
#define MOTOR_RIGHT 2 //Refers to the right motor, used by function setMotorSpeed.
#define MAX_MOTOR_SPEED 100  //Maximum motor duty cycle

//pid.h
#define READING_THRESH  5 // ~0.129 V
#define PID_SPEED       100
#define PROPORTIONAL    8
#define DERIVATIVE      0

//lcd.h  commands
#define LCD_CLEAR 	0x01
#define LCD_HOME 	0x02
#define LCD_CURSOR 	0x80

//permissible value of state in main.c
#define STRAIGHT 0
#define RIGHT 3
#define LEFT 2
#define STOP 1
#define START 4

//Maximum length for no cross signal
#define BLIND_TIME_LIMIT    10000

// threshold value for middle sensor
#define READING_THRESH_MID  15

//event detection: wait time for the next cross line or signal to appear. 
//Affects turning
#define EVENT_INTERVAL_TIME     700

//Turn parameters. 
#define TURN_TIMER_FULL         900 //Turn allocated for turning, assume all turn is 90 degrees and takes about the same time

#define LEFT_TURN_LEFTSPEED     10
#define LEFT_TURN_RIGHTSPEED    100
#define RIGHT_TURN_LEFTSPEED    100
#define RIGHT_TURN_RIGHTSPEED   10

// bool hacks
#define bool char
#define true 1
#define false 0

#endif
